<?php
namespace app\yunda\model;

use think\Model;
use traits\model\SoftDelete;

/**
 * 积分变动明细表
 * @package app\yunda\model
 */
class ScoreRecord extends Model
{
    use SoftDelete;
    protected $table = 'dp_yd_score_record';
    protected $autoWriteTimestamp = true;

    /**
     * @param string $recharge 积分变动说明
     * @param int $change_score 变动积分
     * @param string $user 变动用户
     */
    public static function createScoreRecord($recharge='no change',$change_score=0,$user='')
    {
        $res=self::create([
            'recharge'=>$recharge,
            'change_score'=>$change_score,
            'user_id'=>$user,
        ]);
        return $res;
    }
}
